﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TeacherPrivilegeWindow.ascx.cs" Inherits="ExaminationSys.View.SystemManage.TeacherPrivilegeWindow" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script type="text/javascript" language="javascript">
    var setID = function (id) {
        try {
            var hidden = document.getElementById('<%=TeacherID.ClientID %>');
            hidden.value = id;
        } catch (e) {
            alert(e);
        }
    };

    var nodeLoad = function (store, operation, options) {
        var node = operation.node;
        var hidden = document.getElementById('<%=TeacherID.ClientID %>');
        var id = hidden.value;
        X.NodeLoad(node.getId(), id, {
            success: function (result) {
                node.removeAll();
                node.set('loading', false);
                node.set("loaded", false);
                var data = Ext.decode(result);
                node.appendChild(data, undefined, true);
                node.expand();
                node.set("loaded", false);
            },

            failure: function (errorMsg) {
                Ext.Msg.alert('Failure', errorMsg);
            }
        });

        return false;
    };
</script>
<input type="hidden" id="TeacherID" runat="server" />
<ext:Window 
    ID="TeacherPrivilegeSetting" 
    runat="server" 
    Icon="Group" 
    Title="教师权限设置"
    Width="400" 
    Height="450" 
    AutoShow="false" 
    Modal="true" 
    Hidden="true"
    Layout="Fit">
    <Items>  
       
                <ext:TreePanel 
                        ID="TreePanelTeacherPrivilege" 
                        runat="server" EnableViewState="false" 
						 Header="false" AutoHeight="true"  SingleExpand="true" Title=""
                AutoScroll="true" Animate="false" EnableDD="true" ContainerScroll="true" Border="false" 
                > 
                        <TopBar>
                       <%-- <ext:Toolbar ID="Toolbar1"  runat="server">
                            <Items>
                       
                                <ext:Button ID="BtnExit" runat="server" Text="取消" Icon="UserAdd">                       
                                  <Listeners>
                                     <Click Handler="#{TeacherPrivilegeSetting}.hide(null);" />
                                </Listeners>
                                </ext:Button>                                               
                            </Items>
                        </ext:Toolbar>--%>
                        </TopBar>
                         <Root>
                            <ext:Node NodeID="0" Text="栏目管理"/>
                        </Root>
                        <Listeners>
                            <BeforeLoad Fn="nodeLoad"/>                            
                        </Listeners>
                    </ext:TreePanel>
    </Items>
    <Buttons>
    
        <ext:Button ID="BtnAddNode" runat="server" Text="保存" Icon="BulletGo">
                       
        <DirectEvents>
            <Click OnEvent="BtnSave_Click" ></Click>                            
        </DirectEvents>
        </ext:Button>
        <ext:Button ID="CancelButton" runat="server" Text="关闭" Icon="Cancel">
            <Listeners>
                 <Click Handler="#{TeacherPrivilegeSetting}.hide(null);" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>